from core.basehandler import BaseHandler
from core.room import Room
from core.support import set_cutscene, get_game
from core.action import Action

class GradLounge(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # build list of actions
        self.add_action(Right)
        self.add_action(Outside)
    
    def get_description(self):
        desc = "You just woke up in the grad lounge on the 3rd floor of SMG after falling asleep coding for professors Lubin and Wyner. You're unbearably warm and you want to go outside for some fresh air. Then all of a sudden you see flames erupt in the corner.  Something is on fire and you need to find a way to get out of here fast!"
        return desc
    
    def get_image(self):
        return 'grad_lounge.jpg'
        
    # report whether this room is illuminated
    # which can happen if the room or player has a lit lamp
    
class Grad_LoungeHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return GradLounge

# define actions for this room

class Right(Action):
    def __init__(self):
        Action.__init__(self, "Right")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Get something from the vending machine"
    
    # set cutscene for when arrive in entrance_hall
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'vending_machine'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"


class Outside(Action):
    def __init__(self):
        Action.__init__(self, "Outside")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Leave the lounge"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'stairs'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
